﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TravelLink.WebModel;

namespace TravelLink.WebApp.UserControl.Member {
    public partial class UC_Member_Right : ControlBase {


     

        public string ISTVal { get; set; }
        public string ISTName { get; set; }



        public bool One_NoDisplay { get; set; }

        public bool Two_NoDisplay { get; set; }

        public bool Three_NoDisplay { get; set; }

        protected void Page_Load(object sender, EventArgs e) {
            UC_Member_RightRecommend1.Visible = !Two_NoDisplay;


            if (!Three_NoDisplay) {
                this.drpPositionLv.DataSource = this.DB.TL_PositionLevel;
                this.drpPositionLv.DataTextField = "Name";
                this.drpPositionLv.DataValueField = "Idx";
                this.drpPositionLv.DataBind();
                this.drpPositionLv.Items.Insert(0, new ListItem("--不限--", "-1"));
                if (this.DB.TL_PositionLevel.Where(u => u.Idx == PL).FirstOrDefault() != null) {
                    drpPositionLv.SelectedValue = PL.ToString();
                }


                this.drpPositionJobType.DataSource = this.DB.TL_PositionType;
                this.drpPositionJobType.DataTextField = "Name";
                this.drpPositionJobType.DataValueField = "Idx";
                this.drpPositionJobType.DataBind();
                this.drpPositionJobType.Items.Insert(0, new ListItem("--不限--", "-1"));
                if (this.DB.TL_PositionType.Where(u => u.Idx == PT).FirstOrDefault() != null) {
                    drpPositionJobType.SelectedValue = PT.ToString();
                }

                if (IST.Length > 0) {
                    var istEntity = this.DB.TL_IndustryType2.Where(u => IST.Contains(u.Idx));
                    if (istEntity != null) {
                        this.ISTVal = string.Join(",", IST);
                        this.ISTName = string.Join(",", istEntity.Select(u => u.Name));      //istEntity.Name;
                    }
                }
            }


        }
    }
}